package ExercicioRMI;

import java.rmi.*;
import java.rmi.server.*;

public class Servidor extends UnicastRemoteObject implements InterfaceServ{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public String strHello(){
		return "Hello";
	}
	
	public Servidor() throws RemoteException {}
	
	public static void main(String[] args){
		
		try {  
	         java.rmi.registry.LocateRegistry.createRegistry(1199);  
	         System.out.println("RMI registry ready.");  
	      } catch (Exception e) {  
	         System.out.println("Exception starting RMI registry:");  
	         e.printStackTrace();  
	      }   

		try {
			InterfaceServ service = new Servidor();
			Naming.rebind("Mensagem Hello", service);
			
		} catch(Exception ex){
			ex.printStackTrace();
		}
		
	}

}
